package cate.common.table.res.adventuretask;

import cate.common.table.EExcelNoteField;
import cate.common.table.EExcelRowClass;
import cate.common.table.ERow;
import cp.solution.util.str.Str;
import cate.common.util.random.RWItem;
import easy.java.dev.note.NoteField;

import java.util.List;

@EExcelRowClass(IDTitle = "任务ID")
public class AdventureTaskBaseRow extends ERow implements RWItem {
    @EExcelNoteField(fieldName = "分组")
    public int quality ;
    @EExcelNoteField(fieldName = "奖励")
    public String rewardStr ;
    @EExcelNoteField(fieldName = "所需情报")
    public String costInformation;
    @EExcelNoteField(fieldName = "所需时间")
    public long costTime ;
    @EExcelNoteField(fieldName = "英雄星级要求")
    public int heroStars ;
    @EExcelNoteField(fieldName = "英雄阵营要求")
    public String campStr ;
    @EExcelNoteField(fieldName = "最大派遣英雄数量")
    public int maxDispatchNum ;
    @EExcelNoteField(fieldName = "权重")
    private int weight;
    @EExcelNoteField(fieldName = "每日接取数量限制")
    public int maxRefreshTimes;
    @EExcelNoteField(fieldName = "任务开服日期限制")
    public int opendayLimit;

    @NoteField("英雄阵营要求")
    public List<Byte> camps ;

    @Override
    public void decode() {
        super.decode();
        camps = Str.strArr2byteList(campStr.split("#"));
        //秒转毫秒
        costTime *= 1000;
    }

    @Override
    public double getWeight() {
        return weight;
    }
}
